#!/bin/bash

CMD="../bin2wave"
WFCFG=./waveform_config.ini

BIN_DIR=WF-2023-10-29
OUT_DIR=waves-10-29

#${CMD} -c ${WFCFG} -b tmp.bin -o xx.txt
#exit

if [ -d ${OUT_DIR} ]; then
    echo "directory ${OUT_DIR} exists."
else
    mkdir ${OUT_DIR}
fi


ch=1

while [ ${ch} -le 16 ]
#while [ ${ch} -le 1 ]
do
    n=1
    while [ $n -le 2 ]
    do
        BIN=${BIN_DIR}"/OS_${ch}_${n}.bin"
        OUTFILE=${OUT_DIR}"/OS_${ch}_$n.txt"
        ${CMD} -c ${WFCFG} -b ${BIN} -o ${OUTFILE}
        n=$((n+1))
    done
    
    ch=$((ch+1))
done
